package MyIO;

import java.io.*;

public class demo7 {
    public static void main(String[] args) throws Exception {
        copy("D:\\照片\\201651723362635996.jpg","D:\\software\\aaa.jpg");
    }
    public static void copy(String path, String obj) throws Exception {
        if (path == null || obj == null){
            return;
        }
        InputStream inputStream = new FileInputStream(path);
        OutputStream outputStream = new FileOutputStream(obj);

        byte[] b = new byte[3];
        int n;
        while ((n = inputStream.read(b)) != -1){
            outputStream.write(b,0,n);

        }

        outputStream.close();
        inputStream.close();
    }
}
